"""
The setuservar module contains the function call to set a SPICE variable value
"""

from _spice_path import spice_path

def _setuservar(spiceref, var_name, new_value, persist):
    searchvi=spiceref.GetVIReference(spice_path + '\\common\\commands\\SetSPICEVariable.vi')
    parnames='Name','Value','persist if not already (F)','error out'
    parvalues=var_name, new_value,persist,0
    searchnames,searchvalues=searchvi.Call(parnames,parvalues)
    varvalue=searchvalues[1]
    return varvalue
